<template>
  <div class="content_panel project_modules">
    <div class="content_panel_top">
      <h3 class="panel_title">
        <span>{{ $t('operation.activityManagement') }}</span><!--活动管理-->
      </h3>
      <el-form ref="form" :model="searchForm" :rules="searchFormRules" :inline="false" class="module_form">
        <el-row :gutter="20">
          <el-col :span="4">
            <el-form-item prop="appName" label="">
              <select-app-list v-model="searchForm.appName" @giveParentData="appData" @change="getConfig" :clearable="false" :placeholder="$t('system.appName')"></select-app-list>
              <!--app名称-->
            </el-form-item>
          </el-col>
          <!--                    <el-col :span="8">
                                  <el-form-item>
                                      <el-button @click="getConfig" icon="el-icon-search" type="primary">{{ $t('common.search') }}</el-button>
                                  </el-form-item>
                              </el-col>-->
        </el-row>
      </el-form><!--el-form end-->
    </div><!--content_panel_top-->

    <div class="module_content">
      <el-form :model="form" :rules="rules" ref="configForm" label-width="120px" class="form_activity">
        <el-row :gutter="20">
          <el-col :span="12">
            <!--最低提现金额-->
            <el-form-item :label="$t('operation.minWithdrawalAmount')" prop="limitAmount">
              <el-input-number v-model="form.limitAmount" controls-position="right" :min="0"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <!-- 注册发送金额 -->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.registerAmountButton==='1'">*</span>
                <span>{{ $t('operation.registerSendAmount') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="registerAmount" v-if="form.registerAmountButton==='1'">
                <el-input-number v-model="form.registerAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.registerAmountButton"></el-switch>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <h3 class="form_title">{{ $t('operation.inviterRewardNode') }}</h3><!--邀请人奖励节点-->
            <!--申请借款-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteLoanAmountButton==='1'">*</span>
                <span>{{ $t('common.applyForLoan') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteLoanAmount" v-if="form.inviteLoanAmountButton==='1'">
                <el-input-number v-model="form.inviteLoanAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteLoanAmountButton"></el-switch>
            </div>
            <!--放款成功-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteLoanSuccessButton==='1'">*</span>
                <span>{{ $t('common.loanSuccess') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteLoanSuccessAmount" v-if="form.inviteLoanSuccessButton==='1'">
                <el-input-number v-model="form.inviteLoanSuccessAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteLoanSuccessButton"></el-switch>
            </div>
            <!--还款成功-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteRepaySuccessButton==='1'">*</span>
                <span>{{ $t('finance.repaySuccess') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteRepaySuccessAmount" v-if="form.inviteRepaySuccessButton==='1'">
                <el-input-number v-model="form.inviteRepaySuccessAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteRepaySuccessButton"></el-switch>
            </div>
          </el-col>
          <el-col :span="12">
            <h3 class="form_title">{{ $t('operation.invitedPersonRewardNode') }}</h3><!--被邀请人奖励节点-->
            <!--申请借款-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteesLoanAmountButton==='1'">*</span>
                <span>{{ $t('common.applyForLoan') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteesLoanAmount" v-if="form.inviteesLoanAmountButton==='1'">
                <el-input-number v-model="form.inviteesLoanAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteesLoanAmountButton"></el-switch>
            </div>
            <!--放款成功-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteesLoanSuccessButton==='1'">*</span>
                <span>{{ $t('common.loanSuccess') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteesLoanSuccessAmount" v-if="form.inviteesLoanSuccessButton==='1'">
                <el-input-number v-model="form.inviteesLoanSuccessAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteesLoanSuccessButton"></el-switch>
            </div>
            <!--还款成功-->
            <div class="form_item_wrapper">
              <div class="label">
                <span class="star" v-if="form.inviteesRepaySuccessButton==='1'">*</span>
                <span>{{ $t('finance.repaySuccess') }}</span>
              </div>
              <el-form-item label-width="0" label="" prop="inviteesRepaySuccessAmount" v-if="form.inviteesRepaySuccessButton==='1'">
                <el-input-number v-model="form.inviteesRepaySuccessAmount" controls-position="right" :min="0"></el-input-number>
              </el-form-item>
              <el-switch active-value="1" inactive-value="0" v-model="form.inviteesRepaySuccessButton"></el-switch>
            </div>
          </el-col>
        </el-row>
        <div class="btn_submit">
          <el-button @click="save" type="primary">{{ $t('common.save') }}</el-button><!--保存-->
        </div>
      </el-form>
    </div>

  </div>
</template>

<script src="./main.js"></script>

<style lang="scss" scoped>
.form_activity {
  display: block;
}

.form_title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 16px;
}

.btn_submit {
  text-align: center;
  margin-top: 30px;
}
::v-deep{
  .el-input-number{
    width: 100%;
    .el-input__inner{
      height: 41px;
    }
  }
}
.form_item_wrapper{
  display: flex;
  height: 40px;
  line-height: 40px;
  margin-bottom: 22px;
  .label{
    width: 120px;
    text-align: right;
    padding-right: 12px;
    .star{
      color:#e65057;
      padding-right: 4px;
    }
  }
  ::v-deep {
    .el-switch {
      height: 40px;
      padding-right: 30px;
    }
    .el-form-item {
      flex-grow: 1;
      padding-right: 16px;
    }
  }
}
</style>
